<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>AdWords::API</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
    <script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
</head>

<body>     
    <div class="banner">
        <h1>
            <span class="type">Class</span> 
            AdWords::API 
            
                <span class="parent">&lt; 
                    
                    Object
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../files/lib/adwords4r_rb.html">lib/adwords4r.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
    
    <div class="description">
        <p>
Wrapper class that serves as the main point of access for all the <a
href="API.html">API</a> usage.
</p>
<p>
Holds all the services, as well as login credentials.
</p>

    </div>
    

    

    
    

    
    
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
    
        <dt>G</dt>
        <dd>
            <ul>
                
                <li><a href="#M000012">get_service</a></li>
                
            </ul>
        </dd>
    
        <dt>N</dt>
        <dd>
            <ul>
                
                <li><a href="#M000000">new</a></li>
                
            </ul>
        </dd>
    
        <dt>P</dt>
        <dd>
            <ul>
                
                <li><a href="#M000008">partial_failure</a>,</li>
                
                <li><a href="#M000009">partial_failure=</a></li>
                
            </ul>
        </dd>
    
        <dt>R</dt>
        <dd>
            <ul>
                
                <li><a href="#M000010">return_money_in_micros</a>,</li>
                
                <li><a href="#M000011">return_money_in_micros=</a></li>
                
            </ul>
        </dd>
    
        <dt>S</dt>
        <dd>
            <ul>
                
                <li><a href="#M000016">service</a></li>
                
            </ul>
        </dd>
    
        <dt>U</dt>
        <dd>
            <ul>
                
                <li><a href="#M000003">use_mcc</a>,</li>
                
                <li><a href="#M000005">use_mcc=</a></li>
                
            </ul>
        </dd>
    
        <dt>V</dt>
        <dd>
            <ul>
                
                <li><a href="#M000006">validate_only</a>,</li>
                
                <li><a href="#M000007">validate_only=</a></li>
                
            </ul>
        </dd>
    
    </dl>
    

    

    

    

    

    
    <div class="sectiontitle">Attributes</div>
    <table border='0' cellpadding='5'>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [R]
            </td>
            <td class='attr-name'>credentials</td>
            <td class='attr-desc'><p>
<a href="AdWordsCredentials.html">AdWordsCredentials</a> object used for
authentication
</p></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [R]
            </td>
            <td class='attr-name'>xml_logger</td>
            <td class='attr-desc'><p>
<a href="AdWordsLogger.html">AdWordsLogger</a> object used for logging SOAP
XML
</p></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [R]
            </td>
            <td class='attr-name'>unit_logger</td>
            <td class='attr-desc'><p>
<a href="AdWordsLogger.html">AdWordsLogger</a> object used for logging
request info
</p></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [R]
            </td>
            <td class='attr-name'>mutex</td>
            <td class='attr-desc'><p>
Mutex object for controlling concurrent access to <a
href="API.html">API</a> object data
</p></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>last_units</td>
            <td class='attr-desc'><p>
Number of units spent on the last operation via this <a
href="API.html">API</a> object
</p></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>total_units</td>
            <td class='attr-desc'><p>
Number of units spent in total, via this <a href="API.html">API</a> object
</p></td>
        </tr>
        
    </table>
    

    
            <div class="sectiontitle">Class Public methods</div>
            
            <div class="method">
                <div class="title" id="M000000">
                    
                    <a name="M000000"></a><b>new</b>(credentials = AdWordsCredentials.new)
                    
                </div>
                
                <div class="description">
                  <p>
Constructor for <a href="API.html">API</a>.
</p>
<p>
Args:
</p>
<ul>
<li>credentials: <a href="AdWordsCredentials.html">AdWordsCredentials</a>
object containing the login information

</li>
</ul>

                </div>
                
                
                
                
                <div class="sourcecode">
                    <p class="source-link">
                        Source: <a href="javascript:toggleSource('M000000_source')" id="l_M000000_source">show</a>
                        
                    </p>
                    <div id="M000000_source" class="dyn-source">
                        <pre><span class="ruby-comment cmt"># File lib/adwords4r.rb, line 69</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">credentials</span> = <span class="ruby-constant">AdWordsCredentials</span>.<span class="ruby-identifier">new</span>)
      <span class="ruby-ivar">@credentials</span> = <span class="ruby-identifier">credentials</span>
      <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">AdWords</span><span class="ruby-operator">::</span><span class="ruby-constant">Service</span>.<span class="ruby-identifier">environments</span>.<span class="ruby-identifier">include?</span> <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">environment</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">AdWords</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>,
            <span class="ruby-node">&quot;Unknown environment #{@credentials.environment}&quot;</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-ivar">@drivers</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
      <span class="ruby-ivar">@wrappers</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
      <span class="ruby-ivar">@total_units</span> = <span class="ruby-value">0</span>
      <span class="ruby-ivar">@last_units</span> = <span class="ruby-value">0</span>
      <span class="ruby-identifier">log_to_console</span> = <span class="ruby-operator">!</span><span class="ruby-constant">ENV</span>[<span class="ruby-value str">'ADWORDS4R_DEBUG'</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span>
          <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'ADWORDS4R_DEBUG'</span>].<span class="ruby-identifier">upcase</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'TRUE'</span>
      <span class="ruby-ivar">@xml_logger</span> = <span class="ruby-constant">AdWordsLogger</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'soap_xml'</span>, <span class="ruby-identifier">log_to_console</span>)
      <span class="ruby-ivar">@unit_logger</span> = <span class="ruby-constant">AdWordsLogger</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'request_info'</span>)
      <span class="ruby-ivar">@mutex</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
      <span class="ruby-identifier">prepare_drivers</span>
    <span class="ruby-keyword kw">end</span></pre>
                    </div>
                </div>
                
            </div>
            
            <div class="sectiontitle">Instance Public methods</div>
            
            <div class="method">
                <div class="title" id="M000012">
                    
                    <a name="M000012"></a><b>get_service</b>(name, version = nil)
                    
                </div>
                
                <div class="description">
                  <p>
Obtain an <a href="API.html">API</a> service, given a version and its name.
</p>
<p>
Args:
</p>
<ul>
<li>name: name for the intended service

</li>
<li>version: intended <a href="API.html">API</a> version. Must be an integer.

</li>
</ul>
<p>
Returns:
</p>
<ul>
<li>the service wrapper for the intended service.

</li>
</ul>

                </div>
                
                
                <div class="aka">
                    This method is also aliased as
                    
                    <a href="API.html#M000016">service</a>
                    
                </div>
                
                
                
                <div class="sourcecode">
                    <p class="source-link">
                        Source: <a href="javascript:toggleSource('M000012_source')" id="l_M000012_source">show</a>
                        
                    </p>
                    <div id="M000012_source" class="dyn-source">
                        <pre><span class="ruby-comment cmt"># File lib/adwords4r.rb, line 235</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_service</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">version</span> = <span class="ruby-keyword kw">nil</span>)
      <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Integer</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">version</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">String</span>
        <span class="ruby-identifier">name</span>, <span class="ruby-identifier">version</span> = <span class="ruby-identifier">version</span>, <span class="ruby-identifier">name</span>
        <span class="ruby-identifier">warn</span>(<span class="ruby-value str">&quot;This parameter order is deprecated. &quot;</span> <span class="ruby-operator">+</span>
             <span class="ruby-value str">&quot;Please use get_service(name, version) from now on.&quot;</span>)
      <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">String</span>
        <span class="ruby-comment cmt"># Do nothing</span>
      <span class="ruby-keyword kw">else</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;Wrong arguments. &quot;</span> <span class="ruby-operator">+</span>
            <span class="ruby-value str">&quot;Expected: get_service(name, version = nil)&quot;</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-identifier">version</span> = <span class="ruby-constant">AdWords</span><span class="ruby-operator">::</span><span class="ruby-constant">Service</span><span class="ruby-operator">::</span><span class="ruby-identifier">get_default_version</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">version</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
      <span class="ruby-comment cmt"># Check if version exists</span>
      <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">AdWords</span><span class="ruby-operator">::</span><span class="ruby-constant">Service</span>.<span class="ruby-identifier">get_versions</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">version</span>)
        <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">version</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">String</span>
          <span class="ruby-identifier">raise</span> <span class="ruby-constant">AdWords</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;Unknown version '#{version}'. Please &quot;</span> <span class="ruby-operator">+</span>
              <span class="ruby-value str">&quot;note that version numbers should be numeric, not strings&quot;</span>
        <span class="ruby-keyword kw">else</span>
          <span class="ruby-identifier">raise</span> <span class="ruby-constant">AdWords</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;Unknown version #{version}&quot;</span>
        <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-comment cmt"># Check if the current environment supports the requested version</span>
      <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">AdWords</span><span class="ruby-operator">::</span><span class="ruby-constant">Service</span>.<span class="ruby-identifier">environment_has_version</span>(<span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">environment</span>,
          <span class="ruby-identifier">version</span>)
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">AdWords</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;Environment #{@credentials.environment}&quot;</span> <span class="ruby-operator">+</span>
            <span class="ruby-node">&quot; does not support version #{version}&quot;</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-comment cmt"># Check if the specified version has the requested service</span>
      <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">AdWords</span><span class="ruby-operator">::</span><span class="ruby-constant">Service</span>.<span class="ruby-identifier">version_has_service</span>(<span class="ruby-identifier">version</span>, <span class="ruby-identifier">name</span>)
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">AdWords</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;Version #{version} does not contain &quot;</span> <span class="ruby-operator">+</span>
          <span class="ruby-node">&quot;service #{name}&quot;</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@wrappers</span>[[<span class="ruby-identifier">version</span>, <span class="ruby-identifier">name</span>]]
    <span class="ruby-keyword kw">end</span></pre>
                    </div>
                </div>
                
            </div>
            
            <div class="method">
                <div class="title" id="M000008">
                    
                    <a name="M000008"></a><b>partial_failure</b>()
                    
                </div>
                
                <div class="description">
                  <p>
Helper method to provide a simple way of performing requests with support
for partial failures. Executes a block of code with partial failures
enabled and/or returns the current status of the property.
</p>
<p>
Args:
</p>
<ul>
<li>accepts a block, which it will execute as a partial failure operation.

</li>
</ul>
<p>
Returns: Boolean indicating whether partial failure operations are
currently enabled or disabled
</p>

                </div>
                
                
                
                
                <div class="sourcecode">
                    <p class="source-link">
                        Source: <a href="javascript:toggleSource('M000008_source')" id="l_M000008_source">show</a>
                        
                    </p>
                    <div id="M000008_source" class="dyn-source">
                        <pre><span class="ruby-comment cmt"># File lib/adwords4r.rb, line 168</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">partial_failure</span>
      <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
        <span class="ruby-identifier">previous</span> = <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">partial_failure</span>
        <span class="ruby-keyword kw">begin</span>
          <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">partial_failure</span> = <span class="ruby-keyword kw">true</span>
          <span class="ruby-keyword kw">yield</span>
        <span class="ruby-keyword kw">ensure</span>
          <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">partial_failure</span> = <span class="ruby-identifier">previous</span>
        <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">partial_failure</span>
    <span class="ruby-keyword kw">end</span></pre>
                    </div>
                </div>
                
            </div>
            
            <div class="method">
                <div class="title" id="M000009">
                    
                    <a name="M000009"></a><b>partial_failure=</b>(value)
                    
                </div>
                
                <div class="description">
                  <p>
Helper method to provide a simple way of performing requests with support
for partial failures.
</p>
<p>
Args:
</p>
<ul>
<li>value: the new value for the property (boolean)

</li>
</ul>

                </div>
                
                
                
                
                <div class="sourcecode">
                    <p class="source-link">
                        Source: <a href="javascript:toggleSource('M000009_source')" id="l_M000009_source">show</a>
                        
                    </p>
                    <div id="M000009_source" class="dyn-source">
                        <pre><span class="ruby-comment cmt"># File lib/adwords4r.rb, line 187</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">partial_failure=</span>(<span class="ruby-identifier">value</span>)
      <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">partial_failure</span> = <span class="ruby-identifier">value</span>
    <span class="ruby-keyword kw">end</span></pre>
                    </div>
                </div>
                
            </div>
            
            <div class="method">
                <div class="title" id="M000010">
                    
                    <a name="M000010"></a><b>return_money_in_micros</b>()
                    
                </div>
                
                <div class="description">
                  <p>
Helper method to provide a simple way of performing requests with the
returnMoneyInMicros option enabled. Executes a block of code with the
option enabled and/or returns the current status of the property.
</p>
<p>
Args:
</p>
<ul>
<li>accepts a block, which it will execute with the returnMoneyInMicros option
enabled.

</li>
</ul>
<p>
Returns: Boolean indicating whether the returnMoneyInMicros option is
currently enabled or disabled
</p>

                </div>
                
                
                
                
                <div class="sourcecode">
                    <p class="source-link">
                        Source: <a href="javascript:toggleSource('M000010_source')" id="l_M000010_source">show</a>
                        
                    </p>
                    <div id="M000010_source" class="dyn-source">
                        <pre><span class="ruby-comment cmt"># File lib/adwords4r.rb, line 203</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">return_money_in_micros</span>
      <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
        <span class="ruby-identifier">previous</span> = <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">return_money_in_micros</span>
        <span class="ruby-keyword kw">begin</span>
          <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">return_money_in_micros</span> = <span class="ruby-keyword kw">true</span>
          <span class="ruby-keyword kw">yield</span>
        <span class="ruby-keyword kw">ensure</span>
          <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">return_money_in_micros</span> = <span class="ruby-identifier">previous</span>
        <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">return_money_in_micros</span>
    <span class="ruby-keyword kw">end</span></pre>
                    </div>
                </div>
                
            </div>
            
            <div class="method">
                <div class="title" id="M000011">
                    
                    <a name="M000011"></a><b>return_money_in_micros=</b>(value)
                    
                </div>
                
                <div class="description">
                  <p>
Helper method to provide a simple way of performing requests with the
returnMoneyInMicros option enabled.
</p>
<p>
Args:
</p>
<ul>
<li>value: the new value for the property (boolean)

</li>
</ul>

                </div>
                
                
                
                
                <div class="sourcecode">
                    <p class="source-link">
                        Source: <a href="javascript:toggleSource('M000011_source')" id="l_M000011_source">show</a>
                        
                    </p>
                    <div id="M000011_source" class="dyn-source">
                        <pre><span class="ruby-comment cmt"># File lib/adwords4r.rb, line 222</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">return_money_in_micros=</span>(<span class="ruby-identifier">value</span>)
      <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">return_money_in_micros</span> = <span class="ruby-identifier">value</span>
    <span class="ruby-keyword kw">end</span></pre>
                    </div>
                </div>
                
            </div>
            
            <div class="method">
                <div class="title" id="M000016">
                    
                    <a name="M000016"></a><b>service</b>(name, version = nil)
                    
                </div>
                
                <div class="description">
                  <p>
Alias for <a href="API.html#M000012">get_service</a>
</p>

                </div>
                
                
                
            </div>
            
            <div class="method">
                <div class="title" id="M000003">
                    
                    <a name="M000003"></a><b>use_mcc</b>()
                    
                </div>
                
                <div class="description">
                  <p>
Helper method to provide a simple way of doing an MCC-level operation
without the need to change credentials. Executes a block of code as an
MCC-level operation and/or returns the current status of the property.
</p>
<p>
Args:
</p>
<ul>
<li>accepts a block, which it will execute as an MCC-level operation.

</li>
</ul>
<p>
Returns: Boolean indicating whether MCC-level operations are currently
enabled or disabled
</p>

                </div>
                
                
                
                
                <div class="sourcecode">
                    <p class="source-link">
                        Source: <a href="javascript:toggleSource('M000003_source')" id="l_M000003_source">show</a>
                        
                    </p>
                    <div id="M000003_source" class="dyn-source">
                        <pre><span class="ruby-comment cmt"># File lib/adwords4r.rb, line 98</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">use_mcc</span>
      <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
        <span class="ruby-identifier">previous</span> = <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">use_mcc</span>
        <span class="ruby-keyword kw">begin</span>
          <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">use_mcc</span> = <span class="ruby-keyword kw">true</span>
          <span class="ruby-keyword kw">yield</span>
        <span class="ruby-keyword kw">ensure</span>
          <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">use_mcc</span> = <span class="ruby-identifier">previous</span>
        <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">use_mcc</span>
    <span class="ruby-keyword kw">end</span></pre>
                    </div>
                </div>
                
            </div>
            
            <div class="method">
                <div class="title" id="M000005">
                    
                    <a name="M000005"></a><b>use_mcc=</b>(value)
                    
                </div>
                
                <div class="description">
                  <p>
Helper method to provide a simple way of doing an MCC-level operation
without the need to change credentials. Sets the value of the property that
controls whether MCC-level operations are enabled or disabled.
</p>
<p>
Args:
</p>
<ul>
<li>value: the new value for the property (boolean)

</li>
</ul>

                </div>
                
                
                
                
                <div class="sourcecode">
                    <p class="source-link">
                        Source: <a href="javascript:toggleSource('M000005_source')" id="l_M000005_source">show</a>
                        
                    </p>
                    <div id="M000005_source" class="dyn-source">
                        <pre><span class="ruby-comment cmt"># File lib/adwords4r.rb, line 118</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">use_mcc=</span>(<span class="ruby-identifier">value</span>)
      <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">use_mcc</span> = <span class="ruby-identifier">value</span>
    <span class="ruby-keyword kw">end</span></pre>
                    </div>
                </div>
                
            </div>
            
            <div class="method">
                <div class="title" id="M000006">
                    
                    <a name="M000006"></a><b>validate_only</b>()
                    
                </div>
                
                <div class="description">
                  <p>
Helper method to provide a simple way of doing a validate-only operation
without the need to change credentials. Executes a block of code as an
validate-only operation and/or returns the current status of the property.
</p>
<p>
Args:
</p>
<ul>
<li>accepts a block, which it will execute as a validate-only operation.

</li>
</ul>
<p>
Returns: Boolean indicating whether validate-only operations are currently
enabled or disabled
</p>

                </div>
                
                
                
                
                <div class="sourcecode">
                    <p class="source-link">
                        Source: <a href="javascript:toggleSource('M000006_source')" id="l_M000006_source">show</a>
                        
                    </p>
                    <div id="M000006_source" class="dyn-source">
                        <pre><span class="ruby-comment cmt"># File lib/adwords4r.rb, line 133</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_only</span>
      <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
        <span class="ruby-identifier">previous</span> = <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">validate_only</span>
        <span class="ruby-keyword kw">begin</span>
          <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">validate_only</span> = <span class="ruby-keyword kw">true</span>
          <span class="ruby-keyword kw">yield</span>
        <span class="ruby-keyword kw">ensure</span>
          <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">validate_only</span> = <span class="ruby-identifier">previous</span>
        <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">validate_only</span>
    <span class="ruby-keyword kw">end</span></pre>
                    </div>
                </div>
                
            </div>
            
            <div class="method">
                <div class="title" id="M000007">
                    
                    <a name="M000007"></a><b>validate_only=</b>(value)
                    
                </div>
                
                <div class="description">
                  <p>
Helper method to provide a simple way of performing validate-only
operations. Sets the value of the property that controls whether
validate-only operations are enabled or disabled.
</p>
<p>
Args:
</p>
<ul>
<li>value: the new value for the property (boolean)

</li>
</ul>

                </div>
                
                
                
                
                <div class="sourcecode">
                    <p class="source-link">
                        Source: <a href="javascript:toggleSource('M000007_source')" id="l_M000007_source">show</a>
                        
                    </p>
                    <div id="M000007_source" class="dyn-source">
                        <pre><span class="ruby-comment cmt"># File lib/adwords4r.rb, line 153</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_only=</span>(<span class="ruby-identifier">value</span>)
      <span class="ruby-ivar">@credentials</span>.<span class="ruby-identifier">validate_only</span> = <span class="ruby-identifier">value</span>
    <span class="ruby-keyword kw">end</span></pre>
                    </div>
                </div>
                
            </div>
            
</div>
    </div>
  </body>
</html>    